Skip to content

feat: add authz dependency injections#1539

Draft
shree-iyengar-dls wants to merge 26 commits into
tiled-token-validationfrom
add_depedency_injection
Draft

feat: add authz dependency injections#1539
shree-iyengar-dls wants to merge 26 commits into
tiled-token-validationfrom
add_depedency_injection

Conversation

@shree-iyengar-dls

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.79%. Comparing base (41e28ca) to head (fa02ed5).

Files with missing lines Patch % Lines
src/blueapi/service/main.py 87.50% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           tiled-token-validation    #1539      +/-   ##
==========================================================
- Coverage                   95.79%   95.79%   -0.01%     
==========================================================
  Files                          44       44              
  Lines                        3280     3326      +46     
==========================================================
+ Hits                         3142     3186      +44     
- Misses                        138      140       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shree-iyengar-dls shree-iyengar-dls marked this pull request as ready for review May 15, 2026 14:27
@shree-iyengar-dls shree-iyengar-dls requested a review from a team as a code owner May 15, 2026 14:27
Comment thread src/blueapi/service/main.py Outdated
@shree-iyengar-dls shree-iyengar-dls marked this pull request as draft May 18, 2026 15:13
@shree-iyengar-dls shree-iyengar-dls changed the title feat: add authz dependency injection feat: add authz dependency injections May 20, 2026
@tpoliaw tpoliaw force-pushed the add_depedency_injection branch from 27a9865 to ae58c78 Compare June 2, 2026 10:21
@tpoliaw tpoliaw changed the base branch from main to submit-task-auth June 2, 2026 10:55
@tpoliaw tpoliaw changed the base branch from submit-task-auth to tiled-token-validation June 2, 2026 11:12
@tpoliaw tpoliaw force-pushed the tiled-token-validation branch from b575c2b to b6049c8 Compare June 3, 2026 10:49
@tpoliaw tpoliaw force-pushed the add_depedency_injection branch from ae58c78 to 8112e4b Compare June 3, 2026 10:49

@ZohebShaikh ZohebShaikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good, few comments

Comment thread src/blueapi/service/authorization.py Outdated
Comment thread src/blueapi/service/main.py Outdated
Comment thread src/blueapi/config.py
Comment thread src/blueapi/service/main.py Outdated
Comment thread tests/unit_tests/service/test_authorization.py Outdated
@tpoliaw tpoliaw force-pushed the tiled-token-validation branch from b6049c8 to 63009c0 Compare June 5, 2026 14:27
@tpoliaw tpoliaw force-pushed the add_depedency_injection branch from 8112e4b to a4c6778 Compare June 5, 2026 14:28
@tpoliaw tpoliaw force-pushed the tiled-token-validation branch from 63009c0 to 9865265 Compare June 5, 2026 16:01
@tpoliaw tpoliaw force-pushed the add_depedency_injection branch from a4c6778 to 4fa20de Compare June 5, 2026 16:01
Comment thread src/blueapi/service/main.py Outdated
):
task = runner.run(interface.get_task_by_id, task_id)

if opa and not opa.admin() and (task and fedid != task.task.metadata.get("user")):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only checks task access if OPA is configured. Do we want to restrict access based on user name when authn is enabled but authz is not?

Comment thread src/blueapi/service/authorization.py Outdated
Comment thread src/blueapi/service/main.py Outdated
Comment thread src/blueapi/config.py
@tpoliaw tpoliaw force-pushed the tiled-token-validation branch from 9865265 to 41e28ca Compare June 8, 2026 20:05
@tpoliaw tpoliaw force-pushed the add_depedency_injection branch from 1168a23 to fa02ed5 Compare June 8, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants